hysop.symbolic.relational module¶
- class hysop.symbolic.relational.Add(*exprs)[source]¶
Bases:
ArithmeticRelation
- default_assumptions = {}¶
- property rel_op¶
- class hysop.symbolic.relational.AddAugmentedAssignment(lhs, rhs)[source]¶
Bases:
AugmentedAssignment
- default_assumptions = {}¶
- class hysop.symbolic.relational.ArithmeticRelation(*exprs)[source]¶
Bases:
NAryRelation
- default_assumptions = {}¶
- class hysop.symbolic.relational.Assignment(lhs, rhs)[source]¶
Bases:
BinaryRelation
Represents variable assignment for code generation.
- default_assumptions = {}¶
- property rel_op¶
- class hysop.symbolic.relational.AugmentedAssignment(lhs, rhs)[source]¶
Bases:
Assignment
Base class for augmented assignments
- default_assumptions = {}¶
- property rel_op¶
- class hysop.symbolic.relational.BinaryFunction(lhs, rhs)[source]¶
Bases:
NAryFunction
- default_assumptions = {}¶
- class hysop.symbolic.relational.BinaryRelation(lhs, rhs)[source]¶
Bases:
NAryRelation
Represents relations bewteen 2 variables.
- default_assumptions = {}¶
- class hysop.symbolic.relational.DivAugmentedAssignment(lhs, rhs)[source]¶
Bases:
AugmentedAssignment
- default_assumptions = {}¶
- class hysop.symbolic.relational.LogicalAND(*exprs)[source]¶
Bases:
LogicalRelation
- default_assumptions = {}¶
- property rel_op¶
- class hysop.symbolic.relational.LogicalEQ(*exprs)[source]¶
Bases:
LogicalRelation
- default_assumptions = {}¶
- property rel_op¶
- class hysop.symbolic.relational.LogicalGE(*exprs)[source]¶
Bases:
LogicalRelation
- default_assumptions = {}¶
- property rel_op¶
- class hysop.symbolic.relational.LogicalGT(*exprs)[source]¶
Bases:
LogicalRelation
- default_assumptions = {}¶
- property rel_op¶
- class hysop.symbolic.relational.LogicalLE(*exprs)[source]¶
Bases:
LogicalRelation
- default_assumptions = {}¶
- property rel_op¶
- class hysop.symbolic.relational.LogicalLT(*exprs)[source]¶
Bases:
LogicalRelation
- default_assumptions = {}¶
- property rel_op¶
- class hysop.symbolic.relational.LogicalNE(*exprs)[source]¶
Bases:
LogicalRelation
- default_assumptions = {}¶
- property rel_op¶
- class hysop.symbolic.relational.LogicalOR(*exprs)[source]¶
Bases:
LogicalRelation
- default_assumptions = {}¶
- property rel_op¶
- class hysop.symbolic.relational.LogicalRelation(*exprs)[source]¶
Bases:
NAryRelation
- default_assumptions = {}¶
- class hysop.symbolic.relational.LogicalXOR(*exprs)[source]¶
Bases:
LogicalRelation
- default_assumptions = {}¶
- property rel_op¶
- class hysop.symbolic.relational.Max(lhs, rhs)[source]¶
Bases:
BinaryFunction
- default_assumptions = {}¶
- property fname¶
- class hysop.symbolic.relational.Min(lhs, rhs)[source]¶
Bases:
BinaryFunction
- default_assumptions = {}¶
- property fname¶
- class hysop.symbolic.relational.ModAugmentedAssignment(lhs, rhs)[source]¶
Bases:
AugmentedAssignment
- default_assumptions = {}¶
- class hysop.symbolic.relational.Mul(*exprs)[source]¶
Bases:
ArithmeticRelation
- default_assumptions = {}¶
- property rel_op¶
- class hysop.symbolic.relational.MulAugmentedAssignment(lhs, rhs)[source]¶
Bases:
AugmentedAssignment
- default_assumptions = {}¶
- class hysop.symbolic.relational.NAryFunction(*exprs)[source]¶
Bases:
Expr
Represents relations bewteen n variables.
- default_assumptions = {}¶
- property fname¶
- property free_symbols¶
Return from the atoms of self those which are free symbols.
Not all free symbols are
Symbol
. Eg: IndexedBase(‘I’)[0].free_symbolsFor most expressions, all symbols are free symbols. For some classes this is not true. e.g. Integrals use Symbols for the dummy variables which are bound variables, so Integral has a method to return all symbols except those. Derivative keeps track of symbols with respect to which it will perform a derivative; those are bound variables, too, so it has its own free_symbols method.
Any other method that uses bound variables should implement a free_symbols method.
- property is_number¶
Returns True if
self
has no free symbols and no undefined functions (AppliedUndef, to be precise). It will be faster thanif not self.free_symbols
, however, sinceis_number
will fail as soon as it hits a free symbol or undefined function.Examples
>>> from sympy import Function, Integral, cos, sin, pi >>> from sympy.abc import x >>> f = Function('f')
>>> x.is_number False >>> f(1).is_number False >>> (2*x).is_number False >>> (2 + Integral(2, x)).is_number False >>> (2 + Integral(2, (x, 1, 2))).is_number True
Not all numbers are Numbers in the SymPy sense:
>>> pi.is_number, pi.is_Number (True, False)
If something is a number it should evaluate to a number with real and imaginary parts that are Numbers; the result may not be comparable, however, since the real and/or imaginary part of the result may not have precision.
>>> cos(1).is_number and cos(1).is_comparable True
>>> z = cos(1)**2 + sin(1)**2 - 1 >>> z.is_number True >>> z.is_comparable False
See also
sympy.core.basic.Basic.is_comparable
- class hysop.symbolic.relational.NAryRelation(*exprs)[source]¶
Bases:
Expr
Represents relations bewteen n variables.
- default_assumptions = {}¶
- property free_symbols¶
Return from the atoms of self those which are free symbols.
Not all free symbols are
Symbol
. Eg: IndexedBase(‘I’)[0].free_symbolsFor most expressions, all symbols are free symbols. For some classes this is not true. e.g. Integrals use Symbols for the dummy variables which are bound variables, so Integral has a method to return all symbols except those. Derivative keeps track of symbols with respect to which it will perform a derivative; those are bound variables, too, so it has its own free_symbols method.
Any other method that uses bound variables should implement a free_symbols method.
- property is_number¶
Returns True if
self
has no free symbols and no undefined functions (AppliedUndef, to be precise). It will be faster thanif not self.free_symbols
, however, sinceis_number
will fail as soon as it hits a free symbol or undefined function.Examples
>>> from sympy import Function, Integral, cos, sin, pi >>> from sympy.abc import x >>> f = Function('f')
>>> x.is_number False >>> f(1).is_number False >>> (2*x).is_number False >>> (2 + Integral(2, x)).is_number False >>> (2 + Integral(2, (x, 1, 2))).is_number True
Not all numbers are Numbers in the SymPy sense:
>>> pi.is_number, pi.is_Number (True, False)
If something is a number it should evaluate to a number with real and imaginary parts that are Numbers; the result may not be comparable, however, since the real and/or imaginary part of the result may not have precision.
>>> cos(1).is_number and cos(1).is_comparable True
>>> z = cos(1)**2 + sin(1)**2 - 1 >>> z.is_number True >>> z.is_comparable False
See also
sympy.core.basic.Basic.is_comparable
- property rel_op¶
- class hysop.symbolic.relational.Pow(*exprs)[source]¶
Bases:
ArithmeticRelation
- default_assumptions = {}¶
- property rel_op¶
- class hysop.symbolic.relational.Round(a)[source]¶
Bases:
UnaryFunction
- default_assumptions = {}¶
- property fname¶
- class hysop.symbolic.relational.SubAugmentedAssignment(lhs, rhs)[source]¶
Bases:
AugmentedAssignment
- default_assumptions = {}¶
- class hysop.symbolic.relational.UnaryFunction(a)[source]¶
Bases:
NAryFunction
- default_assumptions = {}¶